#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
#ifdef __cplusplus
extern "C" {
#endif
btVoronoiSimplexSolver* bullet_NewbtVoronoiSimplexSolver(){
	btVoronoiSimplexSolver* wrap_out = new btVoronoiSimplexSolver();
	return wrap_out;
}

void bullet_btVoronoiSimplexSolver_addVertex(btVoronoiSimplexSolver* c_this,btVector3* w,btVector3* p,btVector3* q){
	btVector3 const& c_arg_w=(btVector3 const&)(*w);
	btVector3 const& c_arg_p=(btVector3 const&)(*p);
	btVector3 const& c_arg_q=(btVector3 const&)(*q);
	c_this->addVertex(c_arg_w,c_arg_p,c_arg_q);
}

void bullet_btVoronoiSimplexSolver_backup_closest(btVoronoiSimplexSolver* c_this,btVector3* v){
	btVector3& c_arg_v=(btVector3&)(*v);
	c_this->backup_closest(c_arg_v);
}

bool bullet_btVoronoiSimplexSolver_closest(btVoronoiSimplexSolver* c_this,btVector3* v){
	btVector3& c_arg_v=(btVector3&)(*v);
	bool c_out = c_this->closest(c_arg_v);
	bool wrap_out = (c_out);
	return wrap_out;
}

bool bullet_btVoronoiSimplexSolver_closestPtPointTetrahedron(btVoronoiSimplexSolver* c_this,btVector3* p,btVector3* a,btVector3* b,btVector3* c,btVector3* d,btSubSimplexClosestResult* finalResult){
	btVector3 const& c_arg_p=(btVector3 const&)(*p);
	btVector3 const& c_arg_a=(btVector3 const&)(*a);
	btVector3 const& c_arg_b=(btVector3 const&)(*b);
	btVector3 const& c_arg_c=(btVector3 const&)(*c);
	btVector3 const& c_arg_d=(btVector3 const&)(*d);
	btSubSimplexClosestResult& c_arg_finalResult=(btSubSimplexClosestResult&)(*finalResult);
	bool c_out = c_this->closestPtPointTetrahedron(c_arg_p,c_arg_a,c_arg_b,c_arg_c,c_arg_d,c_arg_finalResult);
	bool wrap_out = (c_out);
	return wrap_out;
}

bool bullet_btVoronoiSimplexSolver_closestPtPointTriangle(btVoronoiSimplexSolver* c_this,btVector3* p,btVector3* a,btVector3* b,btVector3* c,btSubSimplexClosestResult* result){
	btVector3 const& c_arg_p=(btVector3 const&)(*p);
	btVector3 const& c_arg_a=(btVector3 const&)(*a);
	btVector3 const& c_arg_b=(btVector3 const&)(*b);
	btVector3 const& c_arg_c=(btVector3 const&)(*c);
	btSubSimplexClosestResult& c_arg_result=(btSubSimplexClosestResult&)(*result);
	bool c_out = c_this->closestPtPointTriangle(c_arg_p,c_arg_a,c_arg_b,c_arg_c,c_arg_result);
	bool wrap_out = (c_out);
	return wrap_out;
}

void bullet_btVoronoiSimplexSolver_compute_points(btVoronoiSimplexSolver* c_this,btVector3* p1,btVector3* p2){
	btVector3& c_arg_p1=(btVector3&)(*p1);
	btVector3& c_arg_p2=(btVector3&)(*p2);
	c_this->compute_points(c_arg_p1,c_arg_p2);
}

bool bullet_btVoronoiSimplexSolver_emptySimplex(btVoronoiSimplexSolver* c_this){
	bool c_out = c_this->emptySimplex();
	bool wrap_out = (c_out);
	return wrap_out;
}

bool bullet_btVoronoiSimplexSolver_fullSimplex(btVoronoiSimplexSolver* c_this){
	bool c_out = c_this->fullSimplex();
	bool wrap_out = (c_out);
	return wrap_out;
}

double bullet_btVoronoiSimplexSolver_getEqualVertexThreshold(btVoronoiSimplexSolver* c_this){
	btScalar c_out = c_this->getEqualVertexThreshold();
	double wrap_out = (c_out);
	return wrap_out;
}

btVector3* bullet_btVoronoiSimplexSolver_GetFieldOfM_cachedP1(btVoronoiSimplexSolver* c_this){
	return (btVector3*)(&c_this->m_cachedP1);
}

btVector3* bullet_btVoronoiSimplexSolver_GetFieldOfM_cachedP2(btVoronoiSimplexSolver* c_this){
	return (btVector3*)(&c_this->m_cachedP2);
}

btVector3* bullet_btVoronoiSimplexSolver_GetFieldOfM_cachedV(btVoronoiSimplexSolver* c_this){
	return (btVector3*)(&c_this->m_cachedV);
}

bool bullet_btVoronoiSimplexSolver_GetFieldOfM_cachedValidClosest(btVoronoiSimplexSolver* c_this){
	return (bool)(c_this->m_cachedValidClosest);
}

double bullet_btVoronoiSimplexSolver_GetFieldOfM_equalVertexThreshold(btVoronoiSimplexSolver* c_this){
	return (double)(c_this->m_equalVertexThreshold);
}

btVector3* bullet_btVoronoiSimplexSolver_GetFieldOfM_lastW(btVoronoiSimplexSolver* c_this){
	return (btVector3*)(&c_this->m_lastW);
}

bool bullet_btVoronoiSimplexSolver_GetFieldOfM_needsUpdate(btVoronoiSimplexSolver* c_this){
	return (bool)(c_this->m_needsUpdate);
}

int bullet_btVoronoiSimplexSolver_GetFieldOfM_numVertices(btVoronoiSimplexSolver* c_this){
	return (int)(c_this->m_numVertices);
}

btVector3** bullet_btVoronoiSimplexSolver_GetFieldOfM_simplexPointsP(btVoronoiSimplexSolver* c_this){
	return (btVector3**)(&c_this->m_simplexPointsP);
}

btVector3** bullet_btVoronoiSimplexSolver_GetFieldOfM_simplexPointsQ(btVoronoiSimplexSolver* c_this){
	return (btVector3**)(&c_this->m_simplexPointsQ);
}

btVector3** bullet_btVoronoiSimplexSolver_GetFieldOfM_simplexVectorW(btVoronoiSimplexSolver* c_this){
	return (btVector3**)(&c_this->m_simplexVectorW);
}

int bullet_btVoronoiSimplexSolver_getSimplex(btVoronoiSimplexSolver* c_this,btVector3* pBuf,btVector3* qBuf,btVector3* yBuf){
	btVector3 * c_arg_pBuf=(btVector3 *)(void*)(pBuf);
	btVector3 * c_arg_qBuf=(btVector3 *)(void*)(qBuf);
	btVector3 * c_arg_yBuf=(btVector3 *)(void*)(yBuf);
	int c_out = c_this->getSimplex(c_arg_pBuf,c_arg_qBuf,c_arg_yBuf);
	int wrap_out = (c_out);
	return wrap_out;
}

bool bullet_btVoronoiSimplexSolver_inSimplex(btVoronoiSimplexSolver* c_this,btVector3* w){
	btVector3 const& c_arg_w=(btVector3 const&)(*w);
	bool c_out = c_this->inSimplex(c_arg_w);
	bool wrap_out = (c_out);
	return wrap_out;
}

double bullet_btVoronoiSimplexSolver_maxVertex(btVoronoiSimplexSolver* c_this){
	btScalar c_out = c_this->maxVertex();
	double wrap_out = (c_out);
	return wrap_out;
}

int bullet_btVoronoiSimplexSolver_numVertices(btVoronoiSimplexSolver* c_this){
	int c_out = c_this->numVertices();
	int wrap_out = (c_out);
	return wrap_out;
}

int bullet_btVoronoiSimplexSolver_pointOutsideOfPlane(btVoronoiSimplexSolver* c_this,btVector3* p,btVector3* a,btVector3* b,btVector3* c,btVector3* d){
	btVector3 const& c_arg_p=(btVector3 const&)(*p);
	btVector3 const& c_arg_a=(btVector3 const&)(*a);
	btVector3 const& c_arg_b=(btVector3 const&)(*b);
	btVector3 const& c_arg_c=(btVector3 const&)(*c);
	btVector3 const& c_arg_d=(btVector3 const&)(*d);
	int c_out = c_this->pointOutsideOfPlane(c_arg_p,c_arg_a,c_arg_b,c_arg_c,c_arg_d);
	int wrap_out = (c_out);
	return wrap_out;
}

void bullet_btVoronoiSimplexSolver_reduceVertices(btVoronoiSimplexSolver* c_this,btUsageBitfield* usedVerts){
	btUsageBitfield const& c_arg_usedVerts=(btUsageBitfield const&)(*usedVerts);
	c_this->reduceVertices(c_arg_usedVerts);
}

void bullet_btVoronoiSimplexSolver_removeVertex(btVoronoiSimplexSolver* c_this,int index){
	int c_arg_index=index;
	c_this->removeVertex(c_arg_index);
}

void bullet_btVoronoiSimplexSolver_reset(btVoronoiSimplexSolver* c_this){
	c_this->reset();
}

void bullet_btVoronoiSimplexSolver_setEqualVertexThreshold(btVoronoiSimplexSolver* c_this,double threshold){
	btScalar c_arg_threshold=threshold;
	c_this->setEqualVertexThreshold(c_arg_threshold);
}

bool bullet_btVoronoiSimplexSolver_updateClosestVectorAndPoints(btVoronoiSimplexSolver* c_this){
	bool c_out = c_this->updateClosestVectorAndPoints();
	bool wrap_out = (c_out);
	return wrap_out;
}

btUsageBitfield* bullet_NewbtUsageBitfield(){
	btUsageBitfield* wrap_out = new btUsageBitfield();
	return wrap_out;
}

unsigned short bullet_btUsageBitfield_GetFieldOfUnused1(btUsageBitfield* c_this){
	return (unsigned short)(c_this->unused1);
}

unsigned short bullet_btUsageBitfield_GetFieldOfUnused2(btUsageBitfield* c_this){
	return (unsigned short)(c_this->unused2);
}

unsigned short bullet_btUsageBitfield_GetFieldOfUnused3(btUsageBitfield* c_this){
	return (unsigned short)(c_this->unused3);
}

unsigned short bullet_btUsageBitfield_GetFieldOfUnused4(btUsageBitfield* c_this){
	return (unsigned short)(c_this->unused4);
}

unsigned short bullet_btUsageBitfield_GetFieldOfUsedVertexA(btUsageBitfield* c_this){
	return (unsigned short)(c_this->usedVertexA);
}

unsigned short bullet_btUsageBitfield_GetFieldOfUsedVertexB(btUsageBitfield* c_this){
	return (unsigned short)(c_this->usedVertexB);
}

unsigned short bullet_btUsageBitfield_GetFieldOfUsedVertexC(btUsageBitfield* c_this){
	return (unsigned short)(c_this->usedVertexC);
}

unsigned short bullet_btUsageBitfield_GetFieldOfUsedVertexD(btUsageBitfield* c_this){
	return (unsigned short)(c_this->usedVertexD);
}

void bullet_btUsageBitfield_reset(btUsageBitfield* c_this){
	c_this->reset();
}

btSubSimplexClosestResult* bullet_NewbtSubSimplexClosestResult(){
	btSubSimplexClosestResult* wrap_out = new btSubSimplexClosestResult();
	return wrap_out;
}

double** bullet_btSubSimplexClosestResult_GetFieldOfM_barycentricCoords(btSubSimplexClosestResult* c_this){
	return (double**)(&c_this->m_barycentricCoords);
}

btVector3* bullet_btSubSimplexClosestResult_GetFieldOfM_closestPointOnSimplex(btSubSimplexClosestResult* c_this){
	return (btVector3*)(&c_this->m_closestPointOnSimplex);
}

bool bullet_btSubSimplexClosestResult_GetFieldOfM_degenerate(btSubSimplexClosestResult* c_this){
	return (bool)(c_this->m_degenerate);
}

btUsageBitfield* bullet_btSubSimplexClosestResult_GetFieldOfM_usedVertices(btSubSimplexClosestResult* c_this){
	return (btUsageBitfield*)(&c_this->m_usedVertices);
}

bool bullet_btSubSimplexClosestResult_isValid(btSubSimplexClosestResult* c_this){
	bool c_out = c_this->isValid();
	bool wrap_out = (c_out);
	return wrap_out;
}

void bullet_btSubSimplexClosestResult_reset(btSubSimplexClosestResult* c_this){
	c_this->reset();
}

void bullet_btSubSimplexClosestResult_setBarycentricCoordinates(btSubSimplexClosestResult* c_this,double a,double b,double c,double d){
	btScalar c_arg_a=a;
	btScalar c_arg_b=b;
	btScalar c_arg_c=c;
	btScalar c_arg_d=d;
	c_this->setBarycentricCoordinates(c_arg_a,c_arg_b,c_arg_c,c_arg_d);
}

#ifdef __cplusplus
}
#endif
